package com.hw.ui.code_replace;

import com.hw.base.present.BasePresenter;

public class CodeReplacePresent extends BasePresenter<CodeReplaceModel, CodeReplaceView> implements CodeReplaceModel.CallBack {
    public void codeQuery(String code) {
        view.showProgress();
        model.codeQuery( code,this);
    }

    public void codeReplace(String oldcode, String newcode) {
        view.showProgress();
        model.codeReplace(oldcode, newcode,this);
    }

    @Override
    public void oncodeQuery(String str) {
        if(view==null){
            return;
        }
        view.hideProgress();
        view.codeQuery(str);
    }

    @Override
    public void oncodeQueryFail(String str) {
        if(view==null){
            return;
        }
        view.hideProgress();
        view.codeQueryFail(str);
    }

    @Override
    public void oncodeReplace(String str) {
        if(view==null){
            return;
        }
        view.hideProgress();
        view.codeReplace(str);
    }

    @Override
    public void oncodeReplaceFail(String str) {
        if(view==null){
            return;
        }
        view.hideProgress();
        view.codeReplaceFail(str);
    }
}


